<!DOCTYPE html>
<html lang="zh-CN">
<head>
  <meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=2">
<meta name="theme-color" content="#222">
<meta name="generator" content="Hexo 5.4.0">
  <link rel="apple-touch-icon" sizes="180x180" href="/myblog/images/apple-touch-icon-next.png">
  <link rel="icon" type="image/png" sizes="32x32" href="/myblog/images/favicon-32x32-next.png">
  <link rel="icon" type="image/png" sizes="16x16" href="/myblog/images/favicon-16x16-next.png">
  <link rel="mask-icon" href="/myblog/images/logo.svg" color="#222">

<link rel="stylesheet" href="/myblog/css/main.css">


<link rel="stylesheet" href="/myblog/lib/font-awesome/css/all.min.css">
  <link rel="stylesheet" href="/myblog/lib/pace/pace-theme-minimal.min.css">
  <script src="/myblog/lib/pace/pace.min.js"></script>

<script id="hexo-configurations">
    var NexT = window.NexT || {};
    var CONFIG = {"hostname":"gao-qianwei.gitee.io","root":"/myblog/","scheme":"Gemini","version":"7.8.0","exturl":false,"sidebar":{"position":"left","display":"post","padding":18,"offset":12,"onmobile":false},"copycode":{"enable":false,"show_result":false,"style":null},"back2top":{"enable":true,"sidebar":false,"scrollpercent":false},"bookmark":{"enable":false,"color":"#222","save":"auto"},"fancybox":false,"mediumzoom":false,"lazyload":false,"pangu":false,"comments":{"style":"tabs","active":null,"storage":true,"lazyload":false,"nav":null},"algolia":{"hits":{"per_page":10},"labels":{"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}},"localsearch":{"enable":true,"trigger":"auto","top_n_per_article":1,"unescape":false,"preload":false},"motion":{"enable":true,"async":false,"transition":{"post_block":"fadeIn","post_header":"slideDownIn","post_body":"slideDownIn","coll_header":"slideLeftIn","sidebar":"slideUpIn"}},"path":"search.xml"};
  </script>

  <meta name="description" content="一、string概念    string是STL的字符串类型，通常用来表示字符串。而在使用string之前，字符串通常是用char*表示的。string与char*都可以用来表示字符串，那么二者有什么区别。">
<meta property="og:type" content="article">
<meta property="og:title" content="STL_string容器">
<meta property="og:url" content="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9Astring%E5%AE%B9%E5%99%A8/index.html">
<meta property="og:site_name" content="学无止境">
<meta property="og:description" content="一、string概念    string是STL的字符串类型，通常用来表示字符串。而在使用string之前，字符串通常是用char*表示的。string与char*都可以用来表示字符串，那么二者有什么区别。">
<meta property="og:locale" content="zh_CN">
<meta property="article:published_time" content="2021-05-07T13:33:44.694Z">
<meta property="article:modified_time" content="2021-05-08T07:23:42.599Z">
<meta property="article:author" content="高乾威">
<meta property="article:tag" content="C++">
<meta property="article:tag" content="STL">
<meta property="article:tag" content="STL容器">
<meta name="twitter:card" content="summary">

<link rel="canonical" href="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9Astring%E5%AE%B9%E5%99%A8/">


<script id="page-configurations">
  // https://hexo.io/docs/variables.html
  CONFIG.page = {
    sidebar: "",
    isHome : false,
    isPost : true,
    lang   : 'zh-CN'
  };
</script>

  <title>STL_string容器 | 学无止境</title>
  






  <noscript>
  <style>
  .use-motion .brand,
  .use-motion .menu-item,
  .sidebar-inner,
  .use-motion .post-block,
  .use-motion .pagination,
  .use-motion .comments,
  .use-motion .post-header,
  .use-motion .post-body,
  .use-motion .collection-header { opacity: initial; }

  .use-motion .site-title,
  .use-motion .site-subtitle {
    opacity: initial;
    top: initial;
  }

  .use-motion .logo-line-before i { left: initial; }
  .use-motion .logo-line-after i { right: initial; }
  </style>
</noscript>

</head>

<body itemscope itemtype="http://schema.org/WebPage">
  <div class="container use-motion">
    <div class="headband"></div>

    <header class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-container">
  <div class="site-nav-toggle">
    <div class="toggle" aria-label="切换导航栏">
      <span class="toggle-line toggle-line-first"></span>
      <span class="toggle-line toggle-line-middle"></span>
      <span class="toggle-line toggle-line-last"></span>
    </div>
  </div>

  <div class="site-meta">

    <a href="/myblog/" class="brand" rel="start">
      <span class="logo-line-before"><i></i></span>
      <h1 class="site-title">学无止境</h1>
      <span class="logo-line-after"><i></i></span>
    </a>
  </div>

  <div class="site-nav-right">
    <div class="toggle popup-trigger">
        <i class="fa fa-search fa-fw fa-lg"></i>
    </div>
  </div>
</div>




<nav class="site-nav">
  <ul id="menu" class="main-menu menu">
        <li class="menu-item menu-item-home">

    <a href="/myblog/" rel="section"><i class="fa fa-home fa-fw"></i>首页</a>

  </li>
        <li class="menu-item menu-item-about">

    <a href="/myblog/about/" rel="section"><i class="fa fa-user fa-fw"></i>关于</a>

  </li>
        <li class="menu-item menu-item-tags">

    <a href="/myblog/tags/" rel="section"><i class="fa fa-tags fa-fw"></i>标签</a>

  </li>
        <li class="menu-item menu-item-categories">

    <a href="/myblog/categories/" rel="section"><i class="fa fa-th fa-fw"></i>分类</a>

  </li>
        <li class="menu-item menu-item-archives">

    <a href="/myblog/archives/" rel="section"><i class="fa fa-archive fa-fw"></i>归档</a>

  </li>
        <li class="menu-item menu-item-links">

    <a href="/myblog/links/" rel="section"><i class="fa fa-link fa-fw"></i>友链</a>

  </li>
      <li class="menu-item menu-item-search">
        <a role="button" class="popup-trigger"><i class="fa fa-search fa-fw"></i>搜索
        </a>
      </li>
  </ul>
</nav>



  <div class="search-pop-overlay">
    <div class="popup search-popup">
        <div class="search-header">
  <span class="search-icon">
    <i class="fa fa-search"></i>
  </span>
  <div class="search-input-container">
    <input autocomplete="off" autocapitalize="off"
           placeholder="搜索..." spellcheck="false"
           type="search" class="search-input">
  </div>
  <span class="popup-btn-close">
    <i class="fa fa-times-circle"></i>
  </span>
</div>
<div id="search-result">
  <div id="no-result">
    <i class="fa fa-spinner fa-pulse fa-5x fa-fw"></i>
  </div>
</div>

    </div>
  </div>

</div>
    </header>

    
  <div class="back-to-top">
    <i class="fa fa-arrow-up"></i>
    <span>0%</span>
  </div>


    <main class="main">
      <div class="main-inner">
        <div class="content-wrap">
          

          <div class="content post posts-expand">
            

    
  
  
  <article itemscope itemtype="http://schema.org/Article" class="post-block" lang="zh-CN">
    <link itemprop="mainEntityOfPage" href="https://gao-qianwei.gitee.io/myblog/2021/05/07/STL%EF%BC%9Astring%E5%AE%B9%E5%99%A8/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="image" content="/myblog/images/avatar.png">
      <meta itemprop="name" content="高乾威">
      <meta itemprop="description" content="报我楼成秋望月，把君诗读夜回灯">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="学无止境">
    </span>
      <header class="post-header">
        <h1 class="post-title" itemprop="name headline">
          STL_string容器
        </h1>

        <div class="post-meta">

          
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-calendar"></i>
              </span>
              <span class="post-meta-item-text">发表于</span>

              <time title="创建时间：2021-05-07 21:33:44" itemprop="dateCreated datePublished" datetime="2021-05-07T21:33:44+08:00">2021-05-07</time>
            </span>
              <span class="post-meta-item">
                <span class="post-meta-item-icon">
                  <i class="far fa-calendar-check"></i>
                </span>
                <span class="post-meta-item-text">更新于</span>
                <time title="修改时间：2021-05-08 15:23:42" itemprop="dateModified" datetime="2021-05-08T15:23:42+08:00">2021-05-08</time>
              </span>
            <span class="post-meta-item">
              <span class="post-meta-item-icon">
                <i class="far fa-folder"></i>
              </span>
              <span class="post-meta-item-text">分类于</span>
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/C/" itemprop="url" rel="index"><span itemprop="name">C++</span></a>
                </span>
                  ，
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/myblog/categories/C/STL/" itemprop="url" rel="index"><span itemprop="name">STL</span></a>
                </span>
            </span>

          
            <span class="post-meta-item" title="阅读次数" id="busuanzi_container_page_pv" style="display: none;">
              <span class="post-meta-item-icon">
                <i class="fa fa-eye"></i>
              </span>
              <span class="post-meta-item-text">阅读次数：</span>
              <span id="busuanzi_value_page_pv"></span>
            </span>
            <span class="post-meta-divider">|</span>

        </div>
      </header>

    
    
    
    <div class="post-body" itemprop="articleBody">

      
        <h3 id="一、string概念"><a href="#一、string概念" class="headerlink" title="一、string概念"></a>一、string概念</h3><p>    string是STL的字符串类型，通常用来表示字符串。而在使用string之前，字符串通常是用char*表示的。string与char*都可以用来表示字符串，那么二者有什么区别。</p>
<span id="more"></span>

<p>    string和char*的比较:</p>
<ul>
<li><p>string是一个类, char*是一个指向字符的指针。</p>
<p>​     string封装了char*，管理这个字符串，是一个char*型的容器。</p>
</li>
<li><p>string不用考虑内存释放和越界。</p>
<p>​     string管理char*所分配的内存。每一次string的复制，取值都由string类负责维护，不用担心复制越界和取值越界等。</p>
</li>
<li><p>string提供了一系列的字符串操作函数</p>
<p>​     查找find，拷贝copy，删除erase，替换replace，插入insert</p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//string 转 char*</span></span><br><span class="line">string str_1=<span class="string">&quot;string&quot;</span>;</span><br><span class="line"><span class="keyword">const</span> <span class="keyword">char</span>* cstr_1=str.<span class="built_in">c_str</span>();</span><br><span class="line"><span class="comment">//char* 转 string</span></span><br><span class="line"><span class="keyword">char</span>* cstr_2=<span class="string">&quot;char&quot;</span>;</span><br><span class="line"><span class="function">string <span class="title">str_2</span><span class="params">(cstr)</span></span>;</span><br></pre></td></tr></table></figure>



<h3 id="二、string的构造函数"><a href="#二、string的构造函数" class="headerlink" title="二、string的构造函数"></a>二、string的构造函数</h3><ol>
<li><p>默认构造函数：string();    //构造一个空的字符串string s1。</p>
</li>
<li><p>构造函数：string(const string &amp;str); //构造一个与str一样的string。如string s1(s2)。</p>
</li>
<li><p>带参数的构造函数：</p>
<p>string(const char *s);  //用字符串s初始化</p>
<p>string(int n,char c);  //用n个字符c初始化</p>
</li>
</ol>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br></pre></td><td class="code"><pre><span class="line">string s1; <span class="comment">//调用无参构造</span></span><br><span class="line"><span class="function">string <span class="title">s2</span><span class="params">(<span class="number">10</span>, <span class="string">&#x27;a&#x27;</span>)</span></span>;</span><br><span class="line"><span class="function">string <span class="title">s3</span><span class="params">(<span class="string">&quot;abcdefg&quot;</span>)</span></span>;</span><br><span class="line"><span class="function">string <span class="title">s4</span><span class="params">(s3)</span></span>; <span class="comment">//拷贝构造</span></span><br><span class="line"></span><br><span class="line">cout &lt;&lt; s1 &lt;&lt; endl;</span><br><span class="line">cout &lt;&lt; s2 &lt;&lt; endl;</span><br><span class="line">cout &lt;&lt; s3 &lt;&lt; endl;</span><br><span class="line">cout &lt;&lt; s4 &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment"></span></span><br><span class="line"><span class="comment">aaaaaaaaaa</span></span><br><span class="line"><span class="comment">abcdefg</span></span><br><span class="line"><span class="comment">abcdefg</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="三、string的存取字符操作"><a href="#三、string的存取字符操作" class="headerlink" title="三、string的存取字符操作"></a>三、string的存取字符操作</h3><p>string类的字符操作：</p>
<ul>
<li>const char &amp;operator[] (int n) const;    //通过[]方式取字符</li>
<li>const char &amp;at(int n) const;     //通过at方法获取字符</li>
<li>char &amp;operator[] (int n);</li>
<li>char &amp;at(int n);</li>
</ul>
<p>    operator[]和at()均返回当前字符串中第n个字符，但二者是有区别的。</p>
<p>    主要区别在于at()在越界时会抛出异常，[]在刚好越界时会返回(char)0，再继续越界时，编译器直接出错。如果你的程序希望可以通过try,catch捕获异常，建议采用at()。</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br></pre></td><td class="code"><pre><span class="line">string s1 = <span class="string">&quot;abcdefg&quot;</span>;</span><br><span class="line"></span><br><span class="line"><span class="comment">//重载[]操作符</span></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; s1.<span class="built_in">size</span>(); i++) &#123;</span><br><span class="line">    cout &lt;&lt; s1[i] &lt;&lt; <span class="string">&quot; &quot;</span>;</span><br><span class="line">&#125;</span><br><span class="line">cout &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line"><span class="comment">//at成员函数</span></span><br><span class="line"><span class="keyword">for</span> (<span class="keyword">int</span> i = <span class="number">0</span>; i &lt; s1.<span class="built_in">size</span>(); i++) &#123;</span><br><span class="line">    cout &lt;&lt; s1.<span class="built_in">at</span>(i) &lt;&lt; <span class="string">&quot; &quot;</span>;</span><br><span class="line">&#125;</span><br><span class="line">cout &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line"><span class="comment">//区别：[]方式 如果访问越界，直接挂了</span></span><br><span class="line"><span class="comment">//at方式 访问越界 抛异常out_of_range</span></span><br><span class="line"></span><br><span class="line"><span class="keyword">try</span> &#123;</span><br><span class="line">    <span class="comment">//cout &lt;&lt; s1[100] &lt;&lt; endl;</span></span><br><span class="line">    cout &lt;&lt; s1.<span class="built_in">at</span>(<span class="number">100</span>) &lt;&lt; endl;</span><br><span class="line">&#125;</span><br><span class="line"><span class="built_in"><span class="keyword">catch</span></span> (...) &#123;</span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;越界!&quot;</span> &lt;&lt; endl;</span><br><span class="line">&#125;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">a b c d e f g</span></span><br><span class="line"><span class="comment">a b c d e f g</span></span><br><span class="line"><span class="comment">越界!</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="四、从string取得const-char-的操作"><a href="#四、从string取得const-char-的操作" class="headerlink" title="四、从string取得const char*的操作"></a>四、从string取得const char*的操作</h3><p>    const char *c_str() const;  //返回一个以’\0’结尾的字符串的首地址</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">//string 转 char*</span></span><br><span class="line">string str_1=<span class="string">&quot;string&quot;</span>;</span><br><span class="line"><span class="keyword">const</span> <span class="keyword">char</span> *cstr_1=str.<span class="built_in">c_str</span>();</span><br></pre></td></tr></table></figure>



<h3 id="五、把string拷贝到char-指向的内存空间的操作"><a href="#五、把string拷贝到char-指向的内存空间的操作" class="headerlink" title="五、把string拷贝到char*指向的内存空间的操作"></a>五、把string拷贝到char*指向的内存空间的操作</h3><p>    int copy(char *s, int n, int pos=0) const; </p>
<p>    把当前串中以pos开始的n个字符拷贝到以s为起始位置的字符数组中，返回实际拷贝的数目。注意要保证s所指向的空间足够大以容纳当前字符串，不然会越界。</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br></pre></td><td class="code"><pre><span class="line">string s1 = <span class="string">&quot;abcdefg&quot;</span>;</span><br><span class="line"><span class="keyword">int</span> n = <span class="number">5</span>;pose</span><br><span class="line">    <span class="keyword">int</span> pose = <span class="number">3</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">char</span>* s2 = (<span class="keyword">char</span>*)<span class="built_in">malloc</span>(n*<span class="built_in"><span class="keyword">sizeof</span></span>(<span class="keyword">char</span>));</span><br><span class="line"><span class="keyword">if</span>(s1.<span class="built_in">copy</span>(s2, n, pose))</span><br><span class="line">    cout &lt;&lt; s2 ;</span><br><span class="line"><span class="keyword">else</span> cout&lt;&lt;<span class="string">&quot;error&quot;</span>&lt;&lt;endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">def</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="六、string的长度"><a href="#六、string的长度" class="headerlink" title="六、string的长度"></a>六、string的长度</h3><p>    int length() const;  //返回当前字符串的长度。长度不包括字符串结尾的’\0’。</p>
<p>    bool empty() const;   //当前字符串是否为空</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br></pre></td><td class="code"><pre><span class="line">string s1 = <span class="string">&quot;abcdefg&quot;</span>;</span><br><span class="line">string s2 = <span class="string">&quot;&quot;</span>;</span><br><span class="line"></span><br><span class="line"><span class="keyword">int</span> s1_length=s1.<span class="built_in">length</span>();  </span><br><span class="line"><span class="keyword">bool</span> s1_empty = s1.<span class="built_in">empty</span>();</span><br><span class="line"><span class="keyword">int</span> s2_length = s2.<span class="built_in">length</span>();  </span><br><span class="line"><span class="keyword">bool</span> s2_empty = s2.<span class="built_in">empty</span>();</span><br><span class="line"></span><br><span class="line">cout &lt;&lt; s1_length &lt;&lt; <span class="string">&quot;     &quot;</span> &lt;&lt; s1_empty &lt;&lt; endl;</span><br><span class="line">cout &lt;&lt; s2_length &lt;&lt; <span class="string">&quot;     &quot;</span> &lt;&lt; s2_empty &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">7     0</span></span><br><span class="line"><span class="comment">0     1</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="七、string的赋值"><a href="#七、string的赋值" class="headerlink" title="七、string的赋值"></a>七、string的赋值</h3><ul>
<li><p>  string &amp;operator=(const string &amp;s);//把字符串s赋给当前的字符串</p>
</li>
<li><p>  string &amp;assign(const char *s); //把字符串s赋给当前的字符串</p>
</li>
<li><p>  string &amp;assign(const char *s, int n); //把字符串s的前n个字符赋给当前的字符串</p>
</li>
<li><p>  string &amp;assign(const string &amp;s); //把字符串s赋给当前字符串</p>
</li>
<li><p>  string &amp;assign(int n,char c); //用n个字符c赋给当前字符串</p>
</li>
<li><p>  string &amp;assign(const string &amp;s,int start, int n); //把字符串s中从start开始的n个字符赋给当前字符串</p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br></pre></td><td class="code"><pre><span class="line">string s1;</span><br><span class="line"><span class="function">string <span class="title">s2</span><span class="params">(<span class="string">&quot;appp&quot;</span>)</span></span>;</span><br><span class="line">s1 = <span class="string">&quot;abcdef&quot;</span>;</span><br><span class="line">cout &lt;&lt; s1 &lt;&lt; endl;</span><br><span class="line">s1 = s2;</span><br><span class="line">cout &lt;&lt; s1 &lt;&lt; endl;</span><br><span class="line">s1 = <span class="string">&#x27;a&#x27;</span>;</span><br><span class="line">cout &lt;&lt; s1 &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line"><span class="comment">//成员方法assign</span></span><br><span class="line">s1.<span class="built_in">assign</span>(<span class="string">&quot;jkl&quot;</span>);</span><br><span class="line">cout &lt;&lt; s1 &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">abcdef</span></span><br><span class="line"><span class="comment">appp</span></span><br><span class="line"><span class="comment">a</span></span><br><span class="line"><span class="comment">jkl</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="八、string字符串连接"><a href="#八、string字符串连接" class="headerlink" title="八、string字符串连接"></a>八、string字符串连接</h3><ul>
<li><p>  string &amp;operator+=(const string &amp;s); //把字符串s连接到当前字符串结尾</p>
</li>
<li><p>  string &amp;operator+=(const char *s);//把字符串s连接到当前字符串结尾</p>
</li>
<li><p>  string &amp;append(const char *s);  //把字符串s连接到当前字符串结尾</p>
</li>
<li><p>  string &amp;append(const char *s,int n); //把字符串s的前n个字符连接到当前字符串结尾</p>
</li>
<li><p>  string &amp;append(const string &amp;s);  //同operator+=()</p>
</li>
<li><p>  string &amp;append(const string &amp;s,int pos, int n);//把字符串s中从pos开始的n个字符连接到当前字符串结尾</p>
</li>
<li><p>  string &amp;append(int n, char c);  //在当前字符串结尾添加n个字符c</p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br></pre></td><td class="code"><pre><span class="line">string s = <span class="string">&quot;abcd&quot;</span>;</span><br><span class="line">string s2 = <span class="string">&quot;1111&quot;</span>;</span><br><span class="line">s += <span class="string">&quot;abcd&quot;</span>;</span><br><span class="line">s += s2;</span><br><span class="line">cout &lt;&lt; s &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line">string s3 = <span class="string">&quot;2222&quot;</span>;</span><br><span class="line">s2.<span class="built_in">append</span>(s3);</span><br><span class="line">cout &lt;&lt; s2 &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line">string s4 = s2 + s3;</span><br><span class="line">cout &lt;&lt; s4 &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">abcdabcd1111</span></span><br><span class="line"><span class="comment">11112222</span></span><br><span class="line"><span class="comment">111122222222</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="九、string的比较"><a href="#九、string的比较" class="headerlink" title="九、string的比较"></a>九、string的比较</h3><ul>
<li><p>  int compare(const string &amp;s) const; //与字符串s比较</p>
</li>
<li><p>  int compare(const char *s) const;  //与字符串s比较</p>
</li>
<li><p>  compare函数在&gt;时返回 1，&lt;时返回 -1，==时返回 0。比较区分大小写，比较时参考字典顺序，排越前面的越小。大写的A比小写的a小。</p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br></pre></td><td class="code"><pre><span class="line">string s1 = <span class="string">&quot;abcd&quot;</span>;</span><br><span class="line">string s2 = <span class="string">&quot;abce&quot;</span>;</span><br><span class="line"><span class="keyword">if</span> (s1.<span class="built_in">compare</span>(s2)==<span class="number">0</span>) &#123;</span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;字符串相等!&quot;</span> &lt;&lt; endl;</span><br><span class="line">&#125;</span><br><span class="line"><span class="keyword">else</span> &#123;</span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;字符串不相等!&quot;</span> &lt;&lt; endl;</span><br><span class="line">&#125;</span><br></pre></td></tr></table></figure>



<h3 id="十、string的子串"><a href="#十、string的子串" class="headerlink" title="十、string的子串"></a>十、string的子串</h3><p>    string substr(int pos=0, int n=npos) const;  //返回由pos开始的n个字符组成的子字符串</p>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br></pre></td><td class="code"><pre><span class="line">string s = <span class="string">&quot;abcdefg&quot;</span>;</span><br><span class="line">string mysubstr = s.<span class="built_in">substr</span>(<span class="number">1</span>, <span class="number">3</span>);</span><br><span class="line">cout &lt;&lt; mysubstr &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">bcd</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="十一、string的查找和替换"><a href="#十一、string的查找和替换" class="headerlink" title="十一、string的查找和替换"></a>十一、string的查找和替换</h3><h5 id="查找"><a href="#查找" class="headerlink" title="查找"></a>查找</h5><ul>
<li><p>  int find(char c,int pos=0) const; //从pos开始查找字符c在当前字符串的位置 </p>
</li>
<li><p>  int find(const char *s, int pos=0) const; //从pos开始查找字符串s在当前字符串的位置</p>
</li>
<li><p>int find(const string &amp;s, int pos=0) const; //从pos开始查找字符串s在当前字符串中的位置</p>
<p>  //find函数如果查找不到，就返回-1</p>
</li>
<li><p>  int rfind(char c, int pos=npos) const;  //从pos开始从后向前查找字符c在当前字符串中的位置 </p>
</li>
<li><p>  int rfind(const char *s, int pos=npos) const;</p>
</li>
<li><p>int rfind(const string &amp;s, int pos=npos) const;</p>
<p>  //rfind是反向查找的意思，如果查找不到， 返回-1 </p>
</li>
</ul>
<h5 id="替换"><a href="#替换" class="headerlink" title="替换"></a>替换</h5><ul>
<li><p>  string &amp;replace(int pos, int n, const char *s);//删除从pos开始的n个字符，然后在pos处插入串s</p>
</li>
<li><p>  string &amp;replace(int pos, int n, const string &amp;s); //删除从pos开始的n个字符，然后在pos处插入串s</p>
</li>
<li><p>  void swap(string &amp;s2);  //交换当前字符串与s2的值 </p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br><span class="line">12</span><br><span class="line">13</span><br><span class="line">14</span><br><span class="line">15</span><br><span class="line">16</span><br><span class="line">17</span><br><span class="line">18</span><br><span class="line">19</span><br><span class="line">20</span><br><span class="line">21</span><br><span class="line">22</span><br><span class="line">23</span><br><span class="line">24</span><br><span class="line">25</span><br><span class="line">26</span><br><span class="line">27</span><br><span class="line">28</span><br><span class="line">29</span><br><span class="line">30</span><br><span class="line">31</span><br><span class="line">32</span><br><span class="line">33</span><br><span class="line">34</span><br><span class="line">35</span><br><span class="line">36</span><br><span class="line">37</span><br><span class="line">38</span><br><span class="line">39</span><br><span class="line">40</span><br><span class="line">41</span><br><span class="line">42</span><br></pre></td><td class="code"><pre><span class="line"><span class="comment">// 字符串的查找和替换</span></span><br><span class="line">string s1 = <span class="string">&quot;wbm hello wbm 111 wbm 222 wbm 333&quot;</span>;</span><br><span class="line"><span class="keyword">size_t</span> index = s1.<span class="built_in">find</span>(<span class="string">&quot;wbm&quot;</span>, <span class="number">0</span>);</span><br><span class="line">cout &lt;&lt; <span class="string">&quot;index: &quot;</span> &lt;&lt; index;  </span><br><span class="line"></span><br><span class="line"><span class="comment">//求itcast出现的次数</span></span><br><span class="line"><span class="keyword">size_t</span> offindex = s1.<span class="built_in">find</span>(<span class="string">&quot;wbm&quot;</span>, <span class="number">0</span>);</span><br><span class="line"><span class="keyword">while</span> (offindex != string::npos)&#123;</span><br><span class="line"></span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;在下标index: &quot;</span> &lt;&lt; offindex &lt;&lt; <span class="string">&quot;找到wbm\n&quot;</span>;</span><br><span class="line">    offindex = offindex + <span class="number">1</span>;</span><br><span class="line">    offindex = s1.<span class="built_in">find</span>(<span class="string">&quot;wbm&quot;</span>, offindex);</span><br><span class="line">&#125; </span><br><span class="line"></span><br><span class="line"><span class="comment">//替换 </span></span><br><span class="line">string s2 = <span class="string">&quot;wbm hello wbm 111 wbm 222 wbm 333&quot;</span>;</span><br><span class="line">s2.<span class="built_in">replace</span>(<span class="number">0</span>, <span class="number">3</span>, <span class="string">&quot;wbm&quot;</span>);</span><br><span class="line">cout &lt;&lt; s2 &lt;&lt; endl; </span><br><span class="line"></span><br><span class="line"><span class="comment">//求itcast出现的次数</span></span><br><span class="line">offindex = s2.<span class="built_in">find</span>(<span class="string">&quot;wbm&quot;</span>, <span class="number">0</span>);</span><br><span class="line"><span class="keyword">while</span> (offindex != string::npos)&#123;</span><br><span class="line"></span><br><span class="line">    cout &lt;&lt; <span class="string">&quot;在下标index: &quot;</span> &lt;&lt; offindex &lt;&lt; <span class="string">&quot;找到wbm\n&quot;</span>;</span><br><span class="line">    s2.<span class="built_in">replace</span>(offindex, <span class="number">3</span>, <span class="string">&quot;WBM&quot;</span>);</span><br><span class="line">    offindex = offindex + <span class="number">1</span>;</span><br><span class="line">    offindex = s1.<span class="built_in">find</span>(<span class="string">&quot;wbm&quot;</span>, offindex);</span><br><span class="line">&#125;</span><br><span class="line">cout &lt;&lt; <span class="string">&quot;替换以后的s2：&quot;</span> &lt;&lt; s2 &lt;&lt; endl; </span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">index: 0在下标index: 0找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 10找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 18找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 26找到wbm</span></span><br><span class="line"><span class="comment">wbm hello wbm 111 wbm 222 wbm 333</span></span><br><span class="line"><span class="comment">在下标index: 0找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 10找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 18找到wbm</span></span><br><span class="line"><span class="comment">在下标index: 26找到wbm</span></span><br><span class="line"><span class="comment">替换以后的s2：WBM hello WBM 111 WBM 222 WBM 333</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>



<h3 id="十二、String的区间删除和插入"><a href="#十二、String的区间删除和插入" class="headerlink" title="十二、String的区间删除和插入"></a>十二、String的区间删除和插入</h3><ul>
<li><p>  string &amp;insert(int pos, const char *s);</p>
</li>
<li><p>  string &amp;insert(int pos, const string &amp;s);//在pos位置插入字符串s</p>
</li>
<li><p>  string &amp;insert(int pos, int n, char c); //在pos位置 插入n个字符c </p>
</li>
<li><p>  string &amp;erase(int pos=0, int n=npos); //删除pos开始的n个字符，返回修改后的字符串</p>
</li>
</ul>
<figure class="highlight cpp"><table><tr><td class="gutter"><pre><span class="line">1</span><br><span class="line">2</span><br><span class="line">3</span><br><span class="line">4</span><br><span class="line">5</span><br><span class="line">6</span><br><span class="line">7</span><br><span class="line">8</span><br><span class="line">9</span><br><span class="line">10</span><br><span class="line">11</span><br></pre></td><td class="code"><pre><span class="line">string s = <span class="string">&quot;abcdefg&quot;</span>;</span><br><span class="line">s.<span class="built_in">insert</span>(<span class="number">3</span>, <span class="string">&quot;111&quot;</span>);</span><br><span class="line">cout &lt;&lt; s &lt;&lt; endl;</span><br><span class="line"></span><br><span class="line">s.<span class="built_in">erase</span>(<span class="number">0</span>, <span class="number">2</span>);</span><br><span class="line">cout &lt;&lt; s &lt;&lt; endl;</span><br><span class="line"><span class="comment">/*</span></span><br><span class="line"><span class="comment">结果：</span></span><br><span class="line"><span class="comment">abc111defg</span></span><br><span class="line"><span class="comment">c111defg</span></span><br><span class="line"><span class="comment">*/</span></span><br></pre></td></tr></table></figure>


    </div>

    
    
    

      <footer class="post-footer">
          <div class="post-tags">
              <a href="/myblog/tags/C/" rel="tag"># C++</a>
              <a href="/myblog/tags/STL/" rel="tag"># STL</a>
              <a href="/myblog/tags/STL%E5%AE%B9%E5%99%A8/" rel="tag"># STL容器</a>
          </div>

        


        
    <div class="post-nav">
      <div class="post-nav-item">
    <a href="/myblog/2021/05/07/STL%EF%BC%9Astack%E5%AE%B9%E5%99%A8/" rel="prev" title="STL_stack容器">
      <i class="fa fa-chevron-left"></i> STL_stack容器
    </a></div>
      <div class="post-nav-item">
    <a href="/myblog/2021/05/07/STL%EF%BC%9Atuple%E5%AE%B9%E5%99%A8/" rel="next" title="STL_tuple容器">
      STL_tuple容器 <i class="fa fa-chevron-right"></i>
    </a></div>
    </div>
      </footer>
    
  </article>
  
  
  



          </div>
          

<script>
  window.addEventListener('tabs:register', () => {
    let { activeClass } = CONFIG.comments;
    if (CONFIG.comments.storage) {
      activeClass = localStorage.getItem('comments_active') || activeClass;
    }
    if (activeClass) {
      let activeTab = document.querySelector(`a[href="#comment-${activeClass}"]`);
      if (activeTab) {
        activeTab.click();
      }
    }
  });
  if (CONFIG.comments.storage) {
    window.addEventListener('tabs:click', event => {
      if (!event.target.matches('.tabs-comment .tab-content .tab-pane')) return;
      let commentClass = event.target.classList[1];
      localStorage.setItem('comments_active', commentClass);
    });
  }
</script>

        </div>
          
  
  <div class="toggle sidebar-toggle">
    <span class="toggle-line toggle-line-first"></span>
    <span class="toggle-line toggle-line-middle"></span>
    <span class="toggle-line toggle-line-last"></span>
  </div>

  <aside class="sidebar">
    <div class="sidebar-inner">

      <ul class="sidebar-nav motion-element">
        <li class="sidebar-nav-toc">
          文章目录
        </li>
        <li class="sidebar-nav-overview">
          站点概览
        </li>
      </ul>

      <!--noindex-->
      <div class="post-toc-wrap sidebar-panel">
          <div class="post-toc motion-element"><ol class="nav"><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%80%E3%80%81string%E6%A6%82%E5%BF%B5"><span class="nav-text">一、string概念</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%8C%E3%80%81string%E7%9A%84%E6%9E%84%E9%80%A0%E5%87%BD%E6%95%B0"><span class="nav-text">二、string的构造函数</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%89%E3%80%81string%E7%9A%84%E5%AD%98%E5%8F%96%E5%AD%97%E7%AC%A6%E6%93%8D%E4%BD%9C"><span class="nav-text">三、string的存取字符操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%9B%9B%E3%80%81%E4%BB%8Estring%E5%8F%96%E5%BE%97const-char-%E7%9A%84%E6%93%8D%E4%BD%9C"><span class="nav-text">四、从string取得const char*的操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%BA%94%E3%80%81%E6%8A%8Astring%E6%8B%B7%E8%B4%9D%E5%88%B0char-%E6%8C%87%E5%90%91%E7%9A%84%E5%86%85%E5%AD%98%E7%A9%BA%E9%97%B4%E7%9A%84%E6%93%8D%E4%BD%9C"><span class="nav-text">五、把string拷贝到char*指向的内存空间的操作</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%AD%E3%80%81string%E7%9A%84%E9%95%BF%E5%BA%A6"><span class="nav-text">六、string的长度</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B8%83%E3%80%81string%E7%9A%84%E8%B5%8B%E5%80%BC"><span class="nav-text">七、string的赋值</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%85%AB%E3%80%81string%E5%AD%97%E7%AC%A6%E4%B8%B2%E8%BF%9E%E6%8E%A5"><span class="nav-text">八、string字符串连接</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E4%B9%9D%E3%80%81string%E7%9A%84%E6%AF%94%E8%BE%83"><span class="nav-text">九、string的比较</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8D%81%E3%80%81string%E7%9A%84%E5%AD%90%E4%B8%B2"><span class="nav-text">十、string的子串</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8D%81%E4%B8%80%E3%80%81string%E7%9A%84%E6%9F%A5%E6%89%BE%E5%92%8C%E6%9B%BF%E6%8D%A2"><span class="nav-text">十一、string的查找和替换</span></a><ol class="nav-child"><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%9F%A5%E6%89%BE"><span class="nav-text">查找</span></a></li><li class="nav-item nav-level-5"><a class="nav-link" href="#%E6%9B%BF%E6%8D%A2"><span class="nav-text">替换</span></a></li></ol></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#%E5%8D%81%E4%BA%8C%E3%80%81String%E7%9A%84%E5%8C%BA%E9%97%B4%E5%88%A0%E9%99%A4%E5%92%8C%E6%8F%92%E5%85%A5"><span class="nav-text">十二、String的区间删除和插入</span></a></li></ol></div>
      </div>
      <!--/noindex-->

      <div class="site-overview-wrap sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
    <img class="site-author-image" itemprop="image" alt="高乾威"
      src="/myblog/images/avatar.png">
  <p class="site-author-name" itemprop="name">高乾威</p>
  <div class="site-description" itemprop="description">报我楼成秋望月，把君诗读夜回灯</div>
</div>
<div class="site-state-wrap motion-element">
  <nav class="site-state">
      <div class="site-state-item site-state-posts">
          <a href="/myblog/archives/">
        
          <span class="site-state-item-count">91</span>
          <span class="site-state-item-name">日志</span>
        </a>
      </div>
      <div class="site-state-item site-state-categories">
            <a href="/myblog/categories/">
          
        <span class="site-state-item-count">27</span>
        <span class="site-state-item-name">分类</span></a>
      </div>
      <div class="site-state-item site-state-tags">
            <a href="/myblog/tags/">
          
        <span class="site-state-item-count">59</span>
        <span class="site-state-item-name">标签</span></a>
      </div>
  </nav>
</div>
  <div class="links-of-author motion-element">
      <span class="links-of-author-item">
        <a href="http://github.com/GaoQianwei" title="GitHub → http:&#x2F;&#x2F;github.com&#x2F;GaoQianwei" rel="noopener" target="_blank">GitHub</a>
      </span>
      <span class="links-of-author-item">
        <a href="mailto:2966807184@qq.com" title="E-Mail → mailto:2966807184@qq.com" rel="noopener" target="_blank">E-Mail</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://www.zhihu.com/people/xue-wu-zhi-jing-75-22" title="知乎 → https:&#x2F;&#x2F;www.zhihu.com&#x2F;people&#x2F;xue-wu-zhi-jing-75-22" rel="noopener" target="_blank">知乎</a>
      </span>
      <span class="links-of-author-item">
        <a href="https://blog.csdn.net/weixin_45341339" title="CSDN → https:&#x2F;&#x2F;blog.csdn.net&#x2F;weixin_45341339" rel="noopener" target="_blank">CSDN</a>
      </span>
  </div>



      </div><div>
  <canvas id="canvasDiyBlock" style="width:60%;">当前浏览器不支持canvas，请更换浏览器后再试</canvas>
<script src="/myblog/js/custom/clock.js"></script>

</div>


    </div>
  </aside>
  <div id="sidebar-dimmer"></div>


      </div>
    </main>

    <footer class="footer">
      <div class="footer-inner">
        

        

<div class="copyright">
  
  &copy; 2021-04 到 
  <span itemprop="copyrightYear">2022</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">高乾威</span>
</div>
  <div class="powered-by">由 <a href="https://hexo.io/" class="theme-link" rel="noopener" target="_blank">Hexo</a> & <a href="https://theme-next.org/" class="theme-link" rel="noopener" target="_blank">NexT.Gemini</a> 强力驱动
  </div>

<span class="post-meta-divider">|</span>

<div class="theme-info">
  <div class="powered-by"></div>
  <span class="post-count">全站共 117.2k 字</span>
</div>

<span class="post-meta-divider">|</span>
        
<div class="busuanzi-count">
  <script async src="https://busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js"></script>
</div>








      </div>
    </footer>
  </div>

  
  <script src="/myblog/lib/anime.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.min.js"></script>
  <script src="/myblog/lib/velocity/velocity.ui.min.js"></script>

<script src="/myblog/js/utils.js"></script>

<script src="/myblog/js/motion.js"></script>


<script src="/myblog/js/schemes/pisces.js"></script>


<script src="/myblog/js/next-boot.js"></script>


  <script defer src="/myblog/lib/three/three.min.js"></script>
    <script defer src="/myblog/lib/three/canvas_lines.min.js"></script>


  




  
<script src="/myblog/js/local-search.js"></script>













  

  

</body>
</html>
